const arr = [1, 2, 3]


async function getVideoInfo(n) {
    return new Promise((resolve, reject) => {
        setTimeout(() => {
            if (n === 3) {
                resolve(n * 10)
            } else {
                // 必须 resolve ，不然程序就停止运行了
                resolve(n+10)
            }
        }, 2000);
    })
}

async function main() {
    for (const n of arr) {
        console.log(n)
        const value = await getVideoInfo(n)
        console.log('Promise resolved with value:', value)
    }
}

main()